package cm.cool.web.data;

import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

import cm.cool.web.bean.Admin;
import cm.cool.web.bean.User;

@Mapper
public interface LoginMapper {
	
	/**
	 * 登录的数据层
	 * @param user
	 * @return
	 */
	@Select("select * from ec_admin where account = #{account}" )
	Admin login(Admin user);
	
	
	/**
	 * 修改状态
	 * @param user
	 * @return
	 */
	@Update("update ec_admin set state = #{0} where account=#{1}" )
	void updateState(String state,String account);
	
	/**
	 * 修改密码
	 * @param passwrod_x 新密码
	 * @param id id
	 * @param password_j 旧密码
	 * @return
	 */
	@Update("update ec_admin set password = #{0} where id=#{1} and password=#{2}" )
	int updatePassword(String passwrod_x,String id,String password_j);
	
}
